//
//  MeTableViewCell.m
//  PT
//
//  Created by jarze on 15/6/10.
//  Copyright (c) 2015年 jarze. All rights reserved.
//

#import "MeTableViewCell.h"
#import "MeItem.h"
#import "LabelItem.h"
#import "NextItem.h"


@interface MeTableViewCell()

//@property (nonatomic, strong) UIImageView *arrowIv;
//@property (nonatomic, strong) UILabel *subLabelView;
@property (nonatomic, strong) UILabel *labelView;



@end


@implementation MeTableViewCell





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)layoutSubviews
{
    
    [super layoutSubviews];
}


+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"meCell";
    
        MeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: ID];
        if (cell == nil) {
            cell = [[MeTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier: ID];
            //cell.backgroundColor = [UIColor clearColor];
            }
    
    
        return cell;

}

- (UILabel *)labelView
{
    if (_labelView == nil) {
        _labelView = [[UILabel alloc] init];
        _labelView.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:13];
        CGRect frame = CGRectMake(0, 0, 70, self.frame.size.height);
        _labelView.textColor = [UIColor redColor];
        _labelView.frame = frame;
        
        _labelView.textAlignment = NSTextAlignmentRight;
        _labelView.text =  @"10 Lessons";
    }
    return _labelView;
}



- (void)setMeItem:(MeItem *)meItem
{
    _meItem = meItem;
    
    self.textLabel.text = self.meItem.teacherName;
    self.imageView.image = [UIImage imageNamed:meItem.teacherIcon];

    self.textLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:15];
    if ([_meItem isKindOfClass:[NextItem class]]) {
        // self.textLabel.text = self.meItem.tilte;
      //self.detailTextLabel
       self.accessoryType =  UITableViewCellAccessoryDisclosureIndicator;
    }
   
    else if ([_meItem isKindOfClass:[LabelItem class]])
    {
      //  self.textLabel.text = self.meItem.tilte;
     //   self.labelView.text = self..label;
        
        self.accessoryView = self.labelView;
        
       
        
        //self.accessibilityLabel = self.labelView.text;
        
    //    self.accessoryView = self.switchBtn;
    //    self.selectionStyle = UITableViewCellSelectionStyleNone;


}
    

}



@end
